package com.wayhome.springfarmework.beans;

import cn.hutool.core.lang.Assert;

import java.util.ArrayList;
import java.util.List;

public class PropertyValues {

    private List<PropertyValue> propertyValueList = new ArrayList<PropertyValue>();

    public PropertyValue[] getPropertyValues() {
        return this.propertyValueList.toArray(new PropertyValue[0]);
    }

    public void addPropertyValue(PropertyValue propertyValue){
        this.propertyValueList.add(propertyValue);
    }

    public PropertyValue getPropertyValue(String name){
        for (PropertyValue propertyValue : propertyValueList){
            if (propertyValue.getName().equals(name)){
                return propertyValue;
            }
        }
       return null;
    }
}
